<template>
	<view class="container">
		<view style="width:calc(100% - 40upx);margin: 20upx;background-color: white;border-radius: 20upx;overflow: hidden;">
			<view class="title-icon">
				小区信息
			</view>
			<view class="list-cell">
				<view class="list-cell-item">
					<view class="item-title">小区名称</view>
					<view class="item-info">{{item.communityName}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">小区编号</view>
					<view class="item-info">{{item.communityId}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">小区地址</view>
					<view class="item-info">{{item.communityAddress}}</view>
				</view>
				<view class="list-cell-last">
					<view class="item-title">小区面积</view>
					<view class="item-info">{{item.communityArea || 0}}㎡</view>
				</view>
			</view>
		</view>

		<view style="width:calc(100% - 40upx);margin: 20upx;background-color: white;border-radius: 20upx;overflow: hidden;">
			<view class="title-icon">
				楼栋信息
			</view>
			<view class="list-cell">
				<view class="list-cell-item">
					<view class="item-title">楼栋名称</view>
					<view class="item-info">{{item.buildingName}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">楼栋编号</view>
					<view class="item-info">{{item.buildingNum}}</view>
				</view>
				<view class="list-cell-last">
					<view class="item-title">占地面积</view>
					<view class="item-info">{{item.buildingArea || 0}}㎡</view>
				</view>
			</view>
		</view>

		<view style="width:calc(100% - 40upx);margin: 20upx;background-color: white;border-radius: 20upx;overflow: hidden;">
			<view class="title-icon">
				单元信息
			</view>
			<view class="list-cell">
				<view class="list-cell-item">
					<view class="item-title">单元名称</view>
					<view class="item-info">{{item.unitName}}单元</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">单元编号</view>
					<view class="item-info">{{item.unitId}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">单元层数</view>
					<view class="item-info">{{item.unitLayer}}层</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">有无电梯</view>
					<view class="item-info">{{item.hasLift == "1010"?"有":"无"}}</view>
				</view>
				<view class="list-cell-last">
					<view class="item-title">单元面积</view>
					<view class="item-info">{{item.unitArea || 0}}㎡</view>
				</view>
			</view>
		</view>

		<view style="width:calc(100% - 40upx);margin: 20upx;background-color: white;border-radius: 20upx;overflow: hidden;">
			<view class="title-icon">
				房屋信息
			</view>
			<view class="list-cell">
				<view class="list-cell-item">
					<view class="item-title">房屋编号</view>
					<view class="item-info">{{item.roomNum}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">所在层数</view>
					<view class="item-info">{{item.roomLayer}}层</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">房屋户型</view>
					<view class="item-info">{{apartment}}</view>
				</view>
				<view class="list-cell-last">
					<view class="item-title">房屋面积</view>
					<view class="item-info">{{item.roomArea || 0}}㎡</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				item: {},
				apartment: ""
			}
		},
		onLoad(options) {
			this.item = JSON.parse(decodeURIComponent(options.item))
			if(this.item.apartment){
				this.apartment = this.$api.util.getApartmentText(this.item.apartment)
			}
		},

		methods: {

		}
	}
</script>
<style lang='scss'>
	page {
		background: $page-color-base;
	}

	.user-section {
		width: 100%;
		height: 240upx;
		position: relative;
		background-color: #94C0FD;
		overflow: hidden;

		.bg {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
		}
	}

	.user-info-box {
		margin-top: 40upx;
		padding-left: 40upx;
		height: 180upx;
		display: flex;
		align-items: center;
		position: relative;
		z-index: 1;

		.portrait {
			width: 130upx;
			height: 130upx;
			border: 5upx solid #fff;
			border-radius: 50%;
		}

		.username {
			font-size: $font-sm;
			color: $font-color-base;
			margin-left: 20upx;
		}
	}

	.user-info-contain {
		margin-left: 40upx;
		width: 70%;
		color: white;
	}

	.user-name-contain {
		font-size: 36rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		font-weight: bold;
	}

	.list-cell {
		padding: 30upx;

		.list-cell-item {
			height: 90upx;
			line-height: 90upx;
			border-bottom: 1px solid #e9eef5;
			display: flex;
			flex-direction: row;
			justify-content: space-between;

			.item-title {
				font-size: 28upx;
				font-weight: border;
				text-align: left;
				margin-left: 20upx;
			}

			.item-info {
				font-size: 24upx;
				text-align: right;
				margin-right: 20upx;
			}
		}

		.list-cell-last {
			height: 90upx;
			line-height: 90upx;
			display: flex;
			flex-direction: row;
			font-size: 30upx;
			justify-content: space-between;

			.item-title {
				font-size: 28upx;
				font-weight: border;
				text-align: left;
				margin-left: 20upx;
			}

			.item-info {
				font-size: 24upx;
				text-align: right;
				margin-right: 20upx;
			}
		}
	}

	.title-icon {
		background-color: #00BFFF;
		color: white;
		font-weight: bold;
		font-size: 30upx;
		padding-left: 20upx;
		width: 160upx;
		border-top-right-radius: 30upx;
		height: 50upx;
		border-bottom-right-radius: 30upx;
		line-height: 50upx;
		margin-top: 30upx;
	}
</style>
